# import time
#
#
# def func1():
#     for i in range(100000000):
#         i+1
#
#
# def func2():
#     for i in range(100000000):
#         i+1
#
#
# start_time = time.time()
# func1()
# func2()
# print(time.time()-start_time)

import time


def func1():
    while True:
        100000000+1
        yield


def func2():
    g = func1()  # 先初始化生成器
    for i in range(100000000):
        i + 1
        next(g)


start_time = time.time()
func2()
print(time.time()-start_time)